<?php
    // 这个接口用于获取数据库中正确的总条数

    include_once '../../fn.php';
    // 构造数据库执行串
    $sql = "select COUNT(*) AS 'total' from posts 
            JOIN users ON posts.user_id = users.id 
            JOIN categories ON posts.category_id = categories.id";
    
    $result = my_query($sql)[0];

    // echo '<pre>';
    // print_r($result);
    // echo '</pre>';
    echo json_encode($result);
?>